<?php
    $xtpl_show      = new XTemplate("view/comment/show.htm");
    
    $title  = "Thông tin chi tiết lời bình";
    $id     = $_GET['id'];
    
    $sql    = "SELECT * FROM comment WHERE id_cm='" . $id . "'";
    $result = mysql_query($sql);
    $row    = mysql_fetch_array($result);
    
    $sql_p  = "SELECT * FROM product WHERE id_p='" . $row['product_id'] . "'";
    $re_p   = mysql_query($sql_p);
    $row_p  = mysql_fetch_array($re_p);
    
    $sql_m  = "SELECT * FROM member WHERE id_m='" . $row['user_id'] . "'";
    $re_m   = mysql_query($sql_m);
    $row_m  = mysql_fetch_array($re_m);
    
    $xtpl_show      -> assign('milkname', $row_p['milkname']);
    $xtpl_show      -> assign('username', $row_m['username']);
    $xtpl_show      -> assign('date', $row['date']);
    $xtpl_show      -> assign('content', $row['content']);
    
    $xtpl_show      -> parse("SHOW");
    $content        = $xtpl_show -> text("SHOW");
?>